package com.jacen.fzxs.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.jacen.fzxs.dao.IBaseDao;


public interface IBaseService<T> {

	public abstract IBaseDao<T> getDao();

	public abstract void insert(T e) throws Exception;
	
	public abstract void insert(List<T> entities) throws Exception;

	public abstract void update(T e) throws Exception;
	
	public abstract void update(T entity, String keyColumn) throws Exception;
	
	public abstract int[] update(List<T> entities, String keyColumn) throws Exception;

	public abstract void delete(T e);

	public abstract void deleteById(String id);

	public abstract void deleteByKey(String keyColumn, Object value)
			throws Exception;

	@Transactional(readOnly = true)
	public abstract T getById(String id);

	@Transactional(readOnly = true)
	public abstract T getByKey(String keyColumn, Object value) throws Exception;

	@Transactional(readOnly = true)
	public abstract boolean existByKey(String keyColumn, Object value)
			throws Exception;

	@Transactional(readOnly = true)
	public abstract List<T> getAll();

	@Transactional(readOnly = true)
	public abstract Long getAllCount();

	@Transactional(readOnly = true)
	public abstract boolean existById(String id);

	public abstract void deleteAll();
	
	public abstract int clearOldData(int monthCount, String dateColName);

}